package setting

import "onvif_server/pkg/storage"

type Network struct {
	Name    string `json:"name" binding:"required"` //网卡名称
	Mode    string `json:"mode" binding:"required,oneof=dhcp static"`
	Ip      string `json:"ip" binding:"required_if=Mode statics,omitempty,ip"`
	Mask    string `json:"mask" binding:"required_if=Mode statics,omitempty,ip"`
	Gateway string `json:"gateway" binding:"required_if=Mode statics,omitempty,ip"`
	Dns     string `json:"dns"  binding:"omitempty,ip"`
}

type SetNetworkReq struct {
	Network
	DefaultName string `json:"default_name" binding:"required"` //默认内部网卡
}

type GetNetworksRes struct {
	Interfaces  []Network
	DefaultName string `json:"default_name"` //默认内部网卡
}

type StoreReq struct {
	Driver string             `json:"driver" binding:"omitempty,oneof=oss cos"`
	Oss    *storage.OssConfig `json:"oss" binding:"required_if=Driver oss,omitempty"`
	Cos    *storage.CosConfig `json:"cos" binding:"required_if=Driver cos,omitempty"`
}

type BoxInfo struct {
	Name     string `json:"name" binding:"omitempty"`
	Location string `json:"location" binding:"omitempty"`
}

type Kv struct {
	Label string `json:"label"`
	Value string `json:"value"`
}

type StoreDriver struct {
	Driver Kv   `json:"driver"`
	Fields []Kv `json:"fields"`
}
